//通过axios发送ajax请求，封装axios
import axios from '../../node_modules/axios'
let base = '';
export const getRequest = (url, params) => {
    return axios({
        method: 'get',//请求类型
        data: params,//发送的数据
        //对发送的参数进行编码
        transformRequest:[function(data){
            let ret='';
            for(let it in data){
                rest+=encodeURIComponent(it)+'='+encodeURIComponent(data[it])+'&'
            }
            return ret;
        }],
        //
        headers:{
            'Content-Type':'application/x-www-form-urlencoded'
        },
        url:'${base}${url}'
    })
}